AUTOCAD CONVERTER

The AutoCAD Converter adds one entry to the conversion lists:
AutoCAD DXF .DXF

This Converter reads and writes DXF files in the ASCII form. The DXF format was designed to represent drawings made in AutoCAD. Through it, many other programs read and write CAD data. The DXF format has become popular format for exchanging CAD drawings and 3D models between many programs.

Geometry
The DXF format continues to evolve with each release of AutoCAD. Older versions of AutoCAD could only represent two-dimensional information, like the lines on a blueprint. In more recent releases, it added true 3D entities. There are many dozens of entities available in AutoCAD, and not all of them are well-suited for making 3D models. The most common 3D-friendly entity in DXF is the 3DFACE. This represents a 3D polygon in the true sense of most 3D programs: it is solid, planar, three-dimensional object.

DXF files are ASCII, that is, they are editable in any text editor. They are broken down into four sections: HEADER, TABLES, BLOCKS, and ENTITIES. Only an ENTITIES section is necessary to convey geometric information, the others are optional.

The HEADER section contains the state of AutoCAD internal variables. The TABLES section holds information about named items, such as line types and layers. Definitions of standard objects are stored in the optional BLOCKS section. Finally and most importantly, the ENTITIES section holds all information about the entities that compose the drawing. For example, entities include lines, circles, arcs, and 3D polygons. At minimum, each entity includes the geometric details of the shape. Optional information includes a pen number to use when plotting the entity, and a layer in which it belongs.

If a BLOCKS section is present, it holds definitions of grouped objects (composed of entities) that might be inserted at various points in the drawing.

AutoCAD loading and saving
To make a DXF file from within AutoCAD, use the "DXFOUT" command. When it prompts "Enter decimal places of accuracy", enter 'e' to save only the ENTITIES section of the DXF file. Only six decimal places of accuracy are needed. In AutoCAD Release 10 and beyond, you should also select "ASCII" format.

To load a DXF file from within AutoCAD, use the "DXFIN" command. It asks for a filename, which has the assumed filename extension ".DXF".

Supported DXF Entities
Although the most recent version of AutoCAD is Release 14, there are many other releases still in common use today, such as Release 9 through 13 and even older versions 2.6 and 2.5. This Converter does not support every entity from every version of AutoCAD. There are dozens of ways to make a good-looking drawing in AutoCAD, yet not all drawing methods will not produce good-looking 3D models.

The closer the fit between your drawing and the entities described below, the better the resulting 3D model. If your drawing does not use these entities, and you're not satisfied with the automatic translation from DXF to your modeling program, then you might try to re-build the object in AutoCAD in order to use entities like these.

For example, some AutoCAD drawings include AME and ACIS solid-modeling surfaces. Although this Converter does not translate this data directly, it is possible to select this entity in AutoCAD and ask for it to be reproduced as 3DFACE entities in the shape of the curved surface. This Converter will translate the 3DFACE entities.

In general, line width is ignored. All lines are simply translated as two-point polygons. If an entity has an elevation set, the resulting polygons of the entity are displaced upward by that amount. If an entity has thickness, it is extruded: points become lines, lines become four-sided polygons, triangles become prisms, and SOLIDs become cubes.

This Converter accepts DXF files that have any combination of line ending characters as used on MS-DOS, Unix and Macintosh.

The following entities are translated:

POINT
Becomes a polygon with one point. If it has thickness, it becomes a polygon with two points, that is, a vertical line, also known as a "lone edge."

LINE
A LINE becomes a polygon with two points. If it has thickness, it becomes a vertical polygon with four sides.

3DLINE
A 3DLINE becomes a polygon with two points.

3DFACE
A 3DFACE becomes a polygon with three or four points.

SOLID and TRACE
SOLID and TRACE entities become a polygon with three or four points. If the entity has thickness, it becomes a set of four or six polygons, like a prism or a brick.

POLYLINE
A POLYLINE becomes a series of polygons with two sides. If it has thickness, it becomes a series of polygons with four sides. Curve fitting and bulges are not supported. Starting and ending widths are ignored. POLYLINEs do not become polygons even if they are closed.

A closed polyline is not the same as a polygon. AutoCAD's DXF format is ambiguous about whether a closed POLYLINE entity could be translated as an open shape or as a polygon-like polygon in a 3D modeling program.

For example, the POLYLINE might represent lines drawn on a surface, and not a filled shape. Because these line segments are still present as "lone edges" or two-point polygons in many 3D formats, it is possible to re-construct them as true polygons in many 3D modeling programs. Select the correct edges and re-define them as a single polygon.

CIRCLE and ARC
CIRCLEs and ARCs become a series of two-point polygons in the shape of a circle or an arc. Each polygon has two points. Adjacent polygons are connected at their endpoints, but each polygon remains a distinct polygon in most 3D formats. (Like the closed POLYLINEs described above, CIRCLEs are not the same as polygons.)

CIRCLEs with thickness become hollow cylinders with that many sides. ARCs with thickness become a series of polygons in that shape.

These extruded polygons are oriented such that they point outward, away from the center point. This is the correct orientation for most programs. On some export Converters, you can flip polygon normals if this isn't the proper orientation, such as if you want to view the object from the inside by default.

BLOCKs and INSERTed BLOCKS
BLOCK definitions from the BLOCKS section are translated and inserted into the drawing if they are invoked with INSERT commands in the ENTITIES section. Otherwise they are ignored. Arbitrary "UCS" or "user coordinate system" extrusion directions are supported. REPEAT counts will duplicate any INSERTed BLOCKs.

Untranslated entities
This Converter translates the entities listed above. Many other DXF entities are not translated, such as TEXT, SHAPE, and DIMENSION. Interchange is not intended as a CAD-to-CAD translator. Instead, it is designed for importing and exporting polygonal 3D data from other non-CAD rendering and animation packages.

Material attributes
DXF files store very little in terms of material attributes. They do not contain actual RGB values for materials, for example. Instead, each entity can be drawn with a given pen number, ranging from 1 to 255. Pen numbers are also known as AutoCAD Color Indexes, or ACI. The default pen number is 7, or white. AutoCAD defines default on-screen colors for each ACI, and these colors are used for the default materials corresponding to each ACI.

Options dialog

Import section

The Arcs and Circles section controls the way ARC and CIRCLE entities are approximated by lines and polygons. If the entity is extruded, each side becomes a polygon itself.

Max arc facet length sets an upper bound on the length of the sides that are created to approximate the curve, with the length given in the same units as used in the drawing. It defaults to 10.0, meaning all sides on ARCs and CIRCLEs will be no longer than 10.0 units in length.

Min number of arc facets sets the minimum number of sides that will be created to approximate ARC and CIRCLE entities. This sets a lower bound for this density. It defaults to 10, meaning all ARCs and CIRCLEs will be approximated with at least ten sides.

Export section
Export polygons as chooses the AutoCAD entity used to represent polygons. The most commonly used polygon-like entity is the 3DFACE, which can have three or four sides. When LINE is selected, the edges of polygons are exported as separate 3D LINEs. When POLYLINE is selected, the outlines of polygons are drawn with that entity. The POLYMESH entity is a more sophisticated method of storing many-sided polygons in DXF files, but not all applications can import it properly.

Because DXF files are ASCII, you can choose the line ending.

Make HEADER controls whether a HEADER section will be included in the file. Some programs, such as AutoCAD itself, use extra information in the header section to properly interpret the file. Many other programs do not require it.

General section
The Objects by section controls the relationship between objects and DXF entities.

On import, this section chooses which attribute of DXF entities is used to specify Interchange objects. The choices are None, Pen, Layer and Block.

When None is selected, all polygons are assigned to a single object.

When Pen is selected, polygons are placed into separate objects based on their ACI pen number. If no pen information is given for an entity, it is placed in a default object.

When Layer is selected, the entity's layer information chooses the object. Within AutoCAD, each layer has a name and a default pen number. If an entity has been placed in a layer, then it becomes part of an object with that layer's name. If no layer name is specified, then the polygons are placed in the default object.

When Block is set, each INSERTed BLOCK is treated as a separate object. BLOCKs can contain other BLOCKs, so this can build a hierarchy of objects.

On export, this section chooses how objects are mapped to AutoCAD entities.

When None is selected, polygons are not given any extra information in the DXF file to differentiate between objects.

When Pen is selected, each object is given a different pen number. The pen number is chosen as follows: if the object has a name such as "ACI45" then pen 45 would be chosen. Otherwise, objects are assigned unique pen numbers, in sequence from pen 1. If there are more than 255 objects, then pen numbers will be re-used for some objects.

When Layer is selected, each object is written to a different layer. If no layer information is selected (that is, neither Objects by or the Color as is set to "Layer") then all entities are placed in layer 0, the default AutoCAD layer.

The layer name is derived from the object name. Layer names are limited to 20 characters, upper-case A through Z plus characters '$', '-' and '_'. Any other characters are changed to '$'.

The preceeding options will create "entities only" DXF files that do not contain any BLOCK definitions. You can always load "entities only" DXF files into an existing drawing in AutoCAD. If a DXF file contained a BLOCKS section, AutoCAD would only allow it to be loaded into a new drawing. "Entities only" files are also more compatible with more 3D programs.

When Block is selected, objects are placed in their own BLOCK definitions and inserted into the entity section of the drawing. BLOCKs will be nested to reflect the hierarchy.

Color as section
The Color as section controls the relationship between materials and DXF entities, to compensate for the lack of true material information in DXF files. Like the Object as section, the Color as section's choices are None, Pen, Layer and Block.

On import, this section chooses which attribute of DXF entities is used to choose Interchange materials.

When None is selected, all polygons are given the default pen number 7, a dull white.

When Pen is selected, the material for a polygon is taken from the pen number and its corresponding color. If no pen number is assigned, polygons are assigned the material for pen 7, the default white color.

When Layer is selected, material names are taken from layer names, and colors are taken from the default color for the layer. Entities placed in these layers take on the corresponding material for that layer. If no layer information is present, default pen 7 material is used.

When Block is set, all polygons created from a BLOCK are given a material based on the block's pen number.

On export, this section controls the mapping of materials to the attributes of DXF entities.

When None is selected, no pen number are assigned.

When Pen is selected, each material becomes a different pen number. If more than 254 materials are present, pen numbers are re-used based on a match between the material color and the default pen colors.

When Layer is selected, each material becomes a separate layer. Polygons in objects are separated into different layers based on their materials. Layer names are derived from material names.

When Block is set, each block is assigned its own pen number.

In general, the Objects by setting overrides the Color as setting. For example, on export if you set both Objects by and Color as to Layer, then entities will be assigned layers from their object instead of their color, and no color information will be represented in the file, just as if Color as was set to None.

On import, if the Make 2D option is set, then all Y and Z values will be swapped, making a traditional blueprint "stand up" in 3D.

On export, if the Make 2D option is set, then this Converter creates a two-dimensional drawing compatible with all versions of AutoCAD. All polygons of two or more points are converted to closed POLYLINE entities. One-point polygons become POINT entities and two-point polygons become two-point POLYLINEs. No hidden-line removal is performed. All edges and sides of polygons are visible in AutoCAD.

The default is Make 2D not set. This creates a three-dimensional drawing file, using the more polygon-like entities to represent polygons, as further controlled by the Export polygons as option.

Background
AutoCAD is made by:
Autodesk, Inc.
111 McInnis Parkway
San Rafael, CA 94903
(800) 879-4233
(415) 507-5000
(415) 491-8311 FAX
www.autodesk.com